﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;


namespace Client
{
    public partial class MyPanel : Panel
    {
        Image image;
        public MyPanel()
        {
            InitializeComponent();
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
            //this.BackgroundImage = Properties.Resources._1024_3;
            //this.BackgroundImageLayout = ImageLayout.Stretch;
            image = Properties.Resources.welcom;
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            Point p = new Point((this.Width-image.Width)/2,(this.Height-image.Height)/2-150);
            e.Graphics.DrawImage(image,new Rectangle(p,image.Size));
        }

     
    }
}
